/**
 * Created by Administrator on 2016/8/2.
 */
window.onload = function(){
    showTime();
};

setInterval(showTime,1000);
function showTime(){
    var now = new Date();
    var endTime = new Date("2016/10/1,12:20:12");
    var mistiming = parseInt((endTime.getTime() - now.getTime())/1000);
    var da = parseInt(mistiming /(24*60*60));
    var hour = parseInt(mistiming /(60*60)%24);
    var mint = parseInt(mistiming /60%60);
    var second = parseInt(mistiming %60);
    document.querySelector('.day').innerHTML = da;
    document.querySelector('.hour').innerHTML = hour;
    document.querySelector('.mint').innerHTML = mint;
    document.querySelector('.second').innerHTML = second;
}